<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<meta name="format-detection" content="telephone=no, email=no" />
		<link rel="stylesheet" type="text/css" href="css/public.css" />
		<link rel="stylesheet" type="text/css" href="css/style.css" />
		<link rel="stylesheet" type="text/css" href="css/share.min.css" />
		<link rel="stylesheet" type="text/css" href="css/layer.css" />
		<title>0元学车，你敢不敢来</title>
		<style type="text/css">
			.layui-m-layerchild {
				background: #fff;
			}

			.share_title {
				text-align: center;
				line-height: .5rem;
			}
			.ycfxyq{
				display: none;
			}
		</style>
	</head>
	<body>
		<div class="bg">

		</div>
		<div class="open-popo">
			<div class="op-bg">
				<span class="phone "></span>
			</div>
			<div class="op-btn">我知道了</div>
		</div>
		<div class="main">


			<div class="top">
				<div class="logo-box">
					<img class="logo" src="images/logo.png">
				</div>
				<div class="login-box">
					<span class="username"></span>
					<div class="login img">登录</div>
				</div>
				<div class="tule-box">
					<img src="images/active-rule.png">
				</div>
				<img class="icon-top" src="images/icon-top_01.png">
			</div>
			<div class="content">
				<div class="item mb22">
					<div class="title">
						<div class="left">
							<img class="title-1" src="images/title-1.png">
						</div>
						<div class="right ">
							<dd>预存享优惠</dd>
							<dt class="fontcolor792312 ycfxyq">预存¥100抵扣¥300</dt>
						</div>
					</div>
					<div class="item-con">
						<div class="leftright">
							<div class="text fontcolorfded1f">
								<dd>-<span class="ycmoney">0</span>¥</dd>
								<dt></dt>
							</div>
							<div class="btn fontcolor792312 toLogin ycbtn">预存</div>
						</div>
					</div>
				</div>
				<div class="item mb22">
					<div class="title">
						<div class="left">
							<img class="title-2" src="images/title-2.png">
						</div>
						<div class="right">
							<dd>分享享优惠+抽奖</dd>
							<dt class="fontcolor792312 ycfxyq">分享到QQ空间抵扣¥100再抽奖</dt>
						</div>
					</div>
					<div class="item-con">
						<div class="leftright">
							<div class="text fontcolorfded1f">
								<dd>-<span class="fxmoney">0</span>¥</dd>
								<dt class="luck_name"></dt>
							</div>
							<div class="btn fontcolor792312 toLogin fxbtn">分享</div>
						</div>
					</div>
				</div>

				<div class="item mb22">
					<div class="title">
						<div class="left">
							<img class="title-3" src="images/title-3.png">
						</div>
						<div class="right ">
							<dd>邀好友享零元学车</dd>
							<dt class="fontcolor792312 ycfxyq">邀请一名好友预存并报名可再享¥100优惠</dt>
						</div>
					</div>
					<div class="item-con">
						<div class="leftright">
							<div class="text fontcolorfded1f">
								<dd><span class="yqnum">0</span>人/-<span class="yqmoney">0</span>¥</dd>
								<dt></dt>
							</div>
							<div class="btn fontcolor792312 toLogin yqbtn">邀请</div>
						</div>
						<div class="culmn fontcolorfded1f">
							<div class="tab-tit">邀请用户名单：</div>
							<div class="row-box">
							</div>
						</div>
					</div>
				</div>
				<div class="youhui-tis mb22">
					<div class="text fontcolor792312">您共获得了<span class="total_amount">0</span>元优惠!</div>
				</div>
				<div class="item mb22">
					<div class="title">
						<div class="left">
							<img class="title-4" src="images/title-4.png">
						</div>
						<div class="right ">
							<dd>活动规则</dd>
							<dt class="fontcolor792312"></dt>
						</div>
					</div>
					<div class="item-con">
						<div class="leftrighttext fontcolorfded1f">
							1. 前100名100元预存,101-200名150元预存,201-300名200元预存,以此类推,300元封顶<br />
							2. 所有优惠将在报名时作为现金抵扣体现或者报名之后进行金额返费，不可兑现，未报名无法领取。<br />
							3. 中奖奖品未报名无法领取。<br />
							4. 预存之后不支持退费，但是可以转让，享受同等优惠。<br />
							5. 报名学员如需退学，需将活动优惠金额进行扣除。<br />
							6. 此活动最终解释权归主办方所有，如有变动，请留意活动页面、电话、短信通知。<br />

						</div>
					</div>
				</div>
				<div class="item mb22">
					<div class="title">
						<div class="left">
							<img class="title-5" src="images/title-5.png">
						</div>
						<div class="right ">
							<dd>时间节点：</dd>
							<dt class="fontcolor792312"></dt>
						</div>
					</div>
					<div class="item-con">
						<div class="leftrighttext fontcolorfded1f">
							1. 预存截止时间为2019年2月25日。<br />
							2. 预存学员报名截止时间为2019年3月20日，过期预存作废。<br />
							3. 奖品领取截止时间为2019年3月31日。<br />

						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="iframe-popo login">
			<div class="iframe">
				<div class="iframe-bg "><span class="html">
						<h1>请先登录</h1>
						<div class="input-row">
							<input type="text" id="recomname" class="input" placeholder="姓名">
						</div>
						<div class="input-row">
							<input type="text" id="recomphone" class="input" placeholder="手机号">
						</div>

						<div class="item">
							<div class="left">
								<div class="input-row">
									<input type="text" id="recomcode" class="input" placeholder="验证码">
								</div>
							</div>
							<div class="right">
								<div class="input-row codebtn ztsbuttom fontcolor792312">
									获取验证码
								</div>
							</div>
						</div>
					</span></div>
				<div class="btn">
					<span class="ok loginbtn">登录</span>
					<span class="close">取消</span>
				</div>
			</div>
		</div>
		<div class="layermainimg wechat">
			<h1>微信扫一扫：分享</h1>

			<div id="qrid"></div>
			<div class="text">打开微信分享二维码给微信好友或者微信朋友圈</div>
			<!-- <div class="bcbtn">保存到本地</div> -->
		</div>
		<div class="layermainimg qq">
			<h1>分享给QQ好友</h1>

			<div id="qrid"></div>
			<div class="text">打开QQ分享二维码给QQ好友</div>
			<!-- <div class="bcbtn">保存到本地</div> -->
		</div>
		<div class="lmi-popo">
			<div class="layermainimg" id="gzh">
				<h1>微信扫一扫：预存</h1>
				<div id="qrid"></div>
				<div class="text">打开微信扫一扫(预存)吧！</div>
			</div>
		</div>
		<div id="share_box" style="display:none;">
			<h1 class="share_title">分享到</h1>
			<div class="social-share" data-initialized="true" style="text-align: center;">
				<a href="#" class="social-share-icon icon-qzone"></a>
			</div>
		</div>
		<div id="Invitation_box" style="display:none;">
			<h1 class="share_title">邀请小伙伴来参加0元学车啦</h1>
			<div class="social-share" data-initialized="true" style="text-align: center;">
				<span href="#" class="social-share-icon icon-wechat"></span>
				<span href="#" class="social-share-icon icon-qq"></span>
				<a href="#" class="social-share-icon icon-qzone"></a>
			</div>
		</div>
		<script src="js/jquery-1.10.2.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/common.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/apiRoot.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/api.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/reg.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/layer.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="http://cdn.staticfile.org/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
		<script src="js/navigator.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			let userInfo = JSON.parse(localStorage.getItem("userInfo"));
			if (userInfo == null || userInfo == "" || userInfo == "null" || userInfo == undefined || userInfo == "undefined") {} else {
				// 分享链接生成
				let fenxiangurl = window.location.href.split("?")[0] + "?fenxiang_id/" + userInfo.id;
				$("#share_box .icon-qzone").attr("href",
					"http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=" + fenxiangurl +
					"&title=0元学车，你敢不敢来&pics=http://djjx.yidianxueche.cn/dingji_active/images/logo_1.png&desc=快来参加0元学车&summary=你的情敌准备带她自驾游，你还在吃鸡？&site=qq空间分享"
				);
				let yaoqingurl = window.location.href.split("?")[0] + "?yaoqing_id/" + userInfo.id;

				$("#Invitation_box .icon-qzone").attr("href",
					"http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=" + yaoqingurl +
					"&title=0元学车，你敢不敢来&pics=http://djjx.yidianxueche.cn/dingji_active/images/logo_1.png&desc=快来参加0元学车&summary=你的情敌准备带她自驾游，你还在吃鸡？&site=qq空间分享"
				);
				// 二维码生成
				$('.qq #qrid').qrcode({
					width: 100,
					height: 100,
					text: yaoqingurl
				});
				$('.wechat #qrid').qrcode({
					width: 100,
					height: 100,
					text: yaoqingurl
				});
				$('#gzh #qrid').qrcode({
					width: 100,
					height: 100,
					text: window.location.href
				});
				$(document).on("click", ".layui-m-layershade", function() {
					$(".layermainimg").css("display", "none");
				})
				$(".qq .bcbtn").click(function() {
					downloadIamge('.qq #qrid', "qrid");
				})
			}

			$(function() {
				// 根据邀请人id获取电话号码
				get_tel();
				get_telfenxiang();
				if (userInfo == null || userInfo == "" || userInfo == "null" || userInfo == undefined || userInfo == "undefined") {} else {
					$(".username").html(userInfo.tel.replace(userInfo.tel.substring(3, 7), '****'))
					$(".login.img").html("退出");
					$(".login.img").addClass("tclogin");
					$(".tclogin").on('click', function() {
						localStorage.removeItem("userInfo");
						window.location.reload();
					})
					let openid = getQueryStringdengy("openid");
					if (openid == null || openid == undefined || openid == "null" || openid == "") {

					} else {
						var openidg = getQueryStringdengy("openid");
						localStorage.setItem("openid", openidg);
						prestore();
					}
					// 个人信息
					info();
					// 邀请列表
					invite_list()
					// 查看是否可以抽奖
					let chancedata = chance();
					$(".luck_name").html(chancedata.data.luck_name);
					if (chancedata.data.is_share == 0) {
						$(".fxbtn").html("分享");
					} else {
						$(".fxbtn").html("去抽奖");
					}

					// 分享
					$(".fxbtn").click(function() {

						if (chancedata.data.is_share == 0) {
							share();
						} else {
							window.location.href = "Luckdraw.html";
						}
					})

					// 预存
					$(".ycbtn").click(function() {

						var ua = navigator.userAgent.toLowerCase(); //获取浏览器标识并转换为小写
						if (ua.match(/MicroMessenger/i) == "micromessenger") {
							layer.open({
								content: '请到微信外部进行支付',
								btn: '确定'
							});

						
						} else {
							prestore_h5();
				
				$(".ycbtn").css("pointer-events", "none");
				setTimeout(function() {
					$(".ycbtn").css("pointer-events", "visible");
				}, 2000)

						}
					})
					$(".lmi-popo").click(function() {
						$("#gzh").css("display", "none");
						$(".lmi-popo").hide(1);
					})
					// 邀请
					$(".yqbtn").click(function() {
						do_Invitation();
						invite();
					})
				}
				$(".op-btn").click(function() {
					$(".open-popo").hide(1);
				})
				$(".login.img").click(function() {
					$(".iframe-popo").show();
					$(".iframe-popo h1").html("");
					$(".iframe-popo .html").css("height", '55%')
				})
				$(".close").on("click", function() {
					$(".iframe-popo").hide(1);
				})
				// 获取验证码
				$(".codebtn").click(function() {
					let recomphone = $("#recomphone").val();
					if (recomphone == "" || recomphone == null || recomphone == undefined || recomphone == "null" || recomphone ==
						"undefined") {
						layer.open({
							content: '电话号码不能为空',
							btn: '确定'
						});
						return;
					}
					if (!regList.phone.test(recomphone)) {
						layer.open({
							content: '请输入正确的电话号码',
							btn: '确定'
						});
						return;
					}
					sent_msg(recomphone)
				})
				// 登录
				$(".loginbtn").click(function() {
					let recomphone = $("#recomphone").val();
					let recomcode = $("#recomcode").val();
					let recomname = $("#recomname").val();
					if (recomname == "" || recomname == null || recomname == undefined || recomname == "null" || recomname ==
						"undefined") {
						layer.open({
							content: '姓名不能为空',
							btn: '确定'
						});
						return;
					}
					
					if (!(/^[\u4e00-\u9fa5]{2,4}$/).test(recomname)) {
						layer.open({
							content: '真实姓名填写有误',
							btn: '确定'
						});
						return false;
					}
					if (recomphone == "" || recomphone == null || recomphone == undefined || recomphone == "null" || recomphone ==
						"undefined") {
						layer.open({
							content: '电话号码不能为空',
							btn: '确定'
						});
						return;
					}
					if (!regList.phone.test(recomphone)) {
						layer.open({
							content: '请输入正确的电话号码',
							btn: '确定'
						});
						return;
					}
					let id = getQueryString("yaoqing_id") || getQueryString("fenxiang_id");
					console.log(id)
					let ajaxdata = {
						tel: recomphone,
						code: recomcode,
						name: recomname,
						school_id: school_id,
						id: id
					}
					login(ajaxdata);
				})

				$(".toLogin").click(function() {
					toLogin();

					$(".iframe-popo h1").html("请先登录");
					$(".iframe-popo .html").css("height", '75%')
				})
				// 活动规则
				$(".tule-box").click(function() {
					document.documentElement.scrollTop = 1214;
					document.body.scrollTop = 1214;
				})
			})
		</script>

	</body>
</html>
